﻿
Imports System.Data.SqlClient
Public Class DProvincia
    Inherits Conexion
    Dim cmd As New SqlCommand



    Public Function buscarprovincias(ByVal PROVINCIA As String) As DataTable
        Try
            conectado()
            cmd = New SqlCommand("sp_buscarprovincia")
            cmd.CommandType = CommandType.StoredProcedure
            cmd.Connection = cnn
            cmd.Parameters.AddWithValue("@nombre_provincia", PROVINCIA)
            Dim DA As New SqlDataAdapter(cmd)
            Dim TABLA As New DataTable
            TABLA.Clear()
            DA.Fill(TABLA)
            Return TABLA

            Return Nothing

        Catch ex As Exception
            MsgBox(ex.Message)
            Return Nothing
        Finally
            desconectado()
        End Try
    End Function

End Class
